<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>注册</title>
    <link rel="stylesheet" href="__CSS__/reg.css">
    <script src="__JS__/jquery-3.2.1.min.js"></script>
</head>
<body>
    <div class="box">
        <div class="head">
            <ul>
                <li>OPPO官网</li>
                <li>OPPO社区</li>
                <li>ColorOS</li>
            </ul>
        </div>
        <div class="mid">
            <p>注册OPPO帐号</p>
            <form class="apple" method="post">
                <input type="text" value="请输入手机号码" name='tell' id='tell'>
                <input type="text" value="短信验证码" style="width:160px" name='tellCode'>
                <input type="button" value="获取验证码" class="getcode"  style="width:100px; height:30px;margin:20px 0px 0px 10px;">
                <input type="text" value="图片验证码"  style="width:160px" name='picCode'>
                <!-- <img id="img_code" onclick="chang_codes()" src="../public/code/image.v.php" style="width:110px;height:40px;margin:25px 0px 0px 10px;"> -->
                <!-- <div><img src="{:captcha_src()}"	alt="captcha" onclick="this.src='{:captcha_src()}'"/ style="width:110px;height:40px;margin:25px 0px 0px 10px;"></div> -->
                <img src="{:Url('home/index/verification')}"	alt="captcha" onclick="this.src='{:Url(\'home/index/verification\')}'"/ style="width:110px;height:40px;margin:25px 0px 0px 10px;">
                <input type="text" value="密码" name='pwd'>
                <input type="text" value="请确认密码" name='pwd2'>
                <input type="submit" value="立即注册" style="background:#00ad6e" name="up">
            </form>
        </div>
        <div class="end">
        <p>© 2005 - 2017 OPPO 版权所有 粤ICP备14056724号-2 联系方式：4001-666-888</p>
        </div>
    </div>
    <script>
        var times=null;
        var time=1000;
        var num=60;
        function timeGo(){
            times=setInterval(function(){
                num=num-1
                $('.getcode').val('重新发送'+num+'S')
                $('.getcode').attr('disabled','disabled')
                if(num<=0){
                    $('.getcode').val('获取验证码')
                    $('.getcode').removeAttr('disabled')
                }
            },time)
        }
        // timeGo()
        $('.getcode').on('click',function(){
            $.ajax({
                url:"{:Url('home/reg/sms')}",
                data:{tell:$('#tell').val()},
                dataType:'html',
                type:'get',
                success:function(data){
                    timeGo()
                }
            })
        })
       
    </script>
</body>
</html>